require 'find'
require 'fileutils'
require 'active_support'

class IOHelper
	
	def remove_directory_recursive_by_name(directoryName, rootPath, silent)
		Find.find(rootPath) do |path|
		  if File.basename(path).ends_with?(directoryName)
		  	puts "removing #{path}"  unless silent
		    FileUtils.remove_dir(path, true)
		    Find.prune
		  end
		end
	end
	
	def file_paths_greater_than(rootPath, length)
		Find.find(rootPath) do |path|
		  if path.length > length then
		  	yield path
		  end
		end
	end
	
end